import Vue from 'vue'
import Router from 'vue-router'

import Home from '@/components/Home'

import E404 from '@/components/errors/404'

//父子组件传值测试
import Main from '@/components/chuanzhi1/Main'
//非父子组件传值测试
import CZMain from '@/components/chuanzhi/main'
//Axios 测试
import AxiosTest from '@/components/axios/axiosTest'
//动态路由测试 和 get参数测试
import ParamsTest from '@/components/params/index'
import DynamicSegment from '@/components/params/dynamicSegment'
import GetParam from '@/components/params/get'

//编程式导航
import Nav from '@/components/navigation/navigation'

//路由嵌套
import Account from '@/components/routerChildren/Account'
import UserInfo from '@/components/routerChildren/UserInfo'
import Order from '@/components/routerChildren/Order'

import ElementUITest from '../components/elementui/ElementUI.vue'

import VuexTest from '@/components/vuex/vuextest'

Vue.use(Router)

export default new Router({
	mode: 'history',
  routes: [
	 
	{
		path:'*',
		name:'E404',
		component:E404
	},
	// {
	// 	path:'/',
	// 	name:'Home',
	// 	component:Home
	// },
    {
      path: '/cz1/main',
      name: 'Main',
      component: Main
    },
	{
	  path: '/axios',
	  name: 'axios',
	  component: AxiosTest
	},
    {
      path: '/cz/main',
      name: 'CZMain',
      component: CZMain
    },
	{
		path:'/params/index',
		name:'ParamsTest',
		component:ParamsTest
	},
	{
		path:'/params/dynamic/:ds',
		name:'DynamicSegment',
		component:DynamicSegment
	},
	{
		path:'/params/get',
		name:'GetParam',
		component:GetParam
	},
	{
		path:'/nav',
		name:'Nav',
		component:Nav
	},
	{
		path:'/account',
		name:'Account',
		component:Account,
		children:[
			{
				path:"user",
				name:UserInfo,
				component:UserInfo
			},
			{
				path:"order",
				name:Order,
				component:Order
			}
		]
	},
	{
		path:"/el",
		name:'elTest',
		component:ElementUITest
	},
	{
		path:'/VuexTest',
		name:VuexTest,
		component:VuexTest
	}
  ]
})